const { pool, executeSql } = require("./db"); // 数据库连接池
const {
  queryOne,
  queryPage,
  insertOne,
  update,
  del,
  queryList,
} = require("./sqlUtils");
const TABLE_WHITE_LIST = ["user", "temp"]; // 白名单
exports.findUserList = async (options) => {
  const { page, pageSize } = options || {};
  const { success, data } = await queryPage(
    "temp", // 表名
    {
      fields: ["*"],
      where: {},
      order: {
        id: "ASC",
      },
      page,
      pageSize,
    },
    TABLE_WHITE_LIST // 白名单
  );
  if (success) {
    return JSON.parse(data.list);
  }
  return null;
};
